import type { Role } from "@/types/role";
import { type Data, request } from "@/utils/axios";

export const roleApi = {
  getRoleList: (): Promise<Data<Role[]>> => {
    return request<Role[]>("/role/list", "GET");
  },
  getRoleById: (id: number): Promise<Data<Role>> => {
    return request<Role>(`/role/${id}`, "GET");
  },
  createRole: (role: Role): Promise<Data<Role>> => {
    return request<Role>("/role/add", "POST", role);
  },
  // getSkillByRoleId: (roleId: number): Promise<Data<any[]>> => {
  //   return request<any[]>(`/skill/${roleId}`, "GET");
  // },
};
